home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 6
/
006.d81
/
baseball adv
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
25KB
|
908 lines
1 rem *** baseball adventure by
2 rem *** samual chiang
3 rem *** translated for the 64 by
4 rem *** donna k. woody
5 poke53280,5:poke53281,1:printchr$(144):poke53272,23:printchr$(8)
10 gosub2040:goto270
12 :
13 rem *** room descriptions ***
14 :
20 onagoto30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180
22 zz=a-16:onzzgoto190,200,210,220,230,240,250,260
30 print" in the parking lot.":n=2:goto340
40 print" outside of [195]andlestick [208]ark. [212]here is a sign over the entrance."
42 n=6:s=1:goto340
50 print" in your office.":n=5:goto340
60 print" in a very long hallway. [212]here are stairs going down."
65 e=5:d=17:goto340
70 print" in the west end of an outer e/w hallway."
75 n=10:w=4:e=6:s=3:goto340
80 print" in the east end of an outer e/w hallway."
85 n=11:w=5:e=7:s=2:goto340
90 print" in an extremely long hallway. [212]here are stairs going up."
95 w=6:u=14:goto340
100 print" in the stands. + section 26 +"
105 s=9:goto340
110 print" in the stands. + section 12 +"
115 s=10:n=8:goto340
120 print" in the stands. + section 6 +"
125 s=5:e=11:n=9:goto340
130 print" in the stands. + section 9 +"
135 s=6:n=12:w=10:goto340
140 print" in the stands. + section 15 +"
145 s=11:n=13:goto340
150 print" in the stands. + section 27 +"
155 s=12:goto340
160 print"[160]in a second level hallway. [212]here are stairs going down."
165 s=24:e=16:w=15:d=7:goto340
170 print" in an office. [212]here is a sign above an officious looking girl."
175 e=14:goto340
180 print" in the [208]ress [194]ox. [217]ou see a famous sportscaster."
185 w=14:goto340
190 print" in a lower level hallway. [212]here are stairs going up."
195 n=20:w=19:e=18:u=4:goto340
200 print"[160]in the clubhouse.":w=17:goto340
210 print"[160]in the locker room.":e=17:goto340
220 print" in the [199]iants' dugout. [217]ou see the manager."
225 s=17:n=21:goto340
230 print"[160]behind the plate, next to the"
232 print"backstop. [212]he [199]iants' dugout is south,"
234 print"the field is west, and the [196]odgers' dugout is north of you."
236 n=22:w=23:s=20:goto340
240 print"[160]in the [196]odgers' dugout.":s=21:goto340
250 print"[160]in the batters' box.":e=21:goto340
260 print"[160]in the scoreboard control room. [217]ou see a button on a control panel."
265 n=14:goto340
266 :
267 rem *** dim variables, initialize ***
268 :
270 dima$(58),a(58),b(12),b$(35),c$(10),d(35),h$(58),i(58),pl$(5),ev$(5),dg$(5)
290 fora=1to20:reada$(a),a(a):h$(a)=a$(a):next
292 fora=1to35:readb$(a):next:fora=13to35:readd(a):next
300 forv=1to5:readpl$(v):readev$(v):readdg$(v):nextv
310 a=3:pt=0:cl=0:hb=0:bt=0:cp=0:tk=0:fb=0:ch=0:jr=0:ca=0:ft=0:wj=0:wc=0:wp=0
312 ck=0:my=0:wl=0
320 n=0:w=0:s=0:e=0:u=0:d=0:printchr$(147):print"[217]ou're";
330 goto20
335 :
337 :
340 forb=1to12:b(b)=0:nextb
346 :
347 rem *** directions ***
348 :
350 print:print"[197]xits: "
360 ifwthenprint"[160][215]est";:b(1)=w:b(2)=w
370 ifnthenprint"[160][206]orth";:b(3)=n:b(4)=n
380 ifethenprint"[160][197]ast";:b(5)=e:b(6)=e
390 ifsthenprint"[160][211]outh";:b(7)=s:b(8)=s
400 ifuthenprint"[160][213]p";:b(9)=u:b(10)=u
410 ifdthenprint"[160][196]own";:b(11)=d:b(12)=d
412 :
413 rem *** if room = 1 & cash is ***
414 rem *** there then end game ***
415 rem *** message for winner ***
416 :
420 ifa=3andch=1then2240
422 :
423 rem *** if room = 23 message ***
424 :
430 print:print:ifa=23thenpoke781,10:poke782,1:sys65520:gosub3000:goto2030
432 :
433 rem *** if not wearing uniform ***
434 rem *** then message ***
435 :
440 if(wp<>1orwc<>1orwl<>1orwj<>1)anda=21thengosub3050:goto2030
442 :
443 rem *** if wearing uniform ***
444 rem *** pants, cleates, jersey, ***
445 rem *** & cap, then message ***
446 :
450 ifwp=1andwj=1andwc=1andwl=1andft=0thengosub3650
452 :
453 rem *** check for items at your ***
454 rem *** location and print them ***
455 :
460 forb=1to20:ifa=abs(a(b))thenc=c+1:goto480
470 nextb:print:goto500
480 ifc<2thenprint"[212]hings you see here:"
490 print"[160]"a$(b):goto470
492 :
493 rem *** increment time & check ***
494 rem *** to see if innings have ***
495 rem *** passed to complete game ***
496 :
500 xx=xx+1
510 ifxx/13=int(xx/13)thengosub3100
520 ifxx>=125then2300
526 :
527 rem *** get command ***
528 :
530 v=fre(0):c=0:print:input"[195]ommand";a$
535 ifa$="buy coke"thena$="give money"
540 ifa$="look"then320
544 :
545 rem *** check for valid ***
546 rem *** command - check for ***
547 rem *** direction first ***
549 :
550 print:forb=1to12:ifa$=b$(b)then570
560 next:goto590
570 ifb(b)<>0thena=b(b):goto320
574 :
575 rem *** not valid direction ***
576 :
580 print"[217]ou can't go that way!":goto530
586 :
587 rem *** inventory command ***
588 :
590 ifa$<>"i"andright$(a$,3)<>"ory"then620
600 print"[217]ou are carrying:":fork=1to10:printc$(k);" ";:ifpos(0)>19thenprint
610 next:goto530
612 :
613 rem *** not direction or ***
614 rem *** or inventory command ***
615 rem *** check for valid verb ***
620 forb=13to35:f=len(b$(b)):ifleft$(a$,f)=b$(b)then640
625 :
626 rem *** not valid verb ***
627 :
630 next:print"[196]on't know what "chr$(34);a$;chr$(34);" means.":goto530
635 :
636 rem *** valid command verb ***
637 rem *** find last 3 letters ***
638 rem *** of noun ***
639 :
640 d$=mid$(a$,len(b$(b))+2):e$=right$(d$,3)
643 :
644 rem *** d(b) holds code for ***
645 rem *** synonym verbs ***
646 rem *** check for verb # ***
647 rem *** & take action ***
648 :
650 ifd(b)<>1then850
655 :
656 rem *** get item ***
657 :
660 forj=1to20:ife$=right$(a$(j),3)anda=abs(a(j))then680
665 :
666 rem *** doesn't recognize noun ***
667 rem *** from list ***
668 :
670 next:print"[201] see no "d$" here.":goto500
675 :
676 rem *** if a(j) is negative # ***
677 rem *** then you can't get noun***
678 :
680 ifa(j)<0thenprint"[217]ou can't get that!":goto500
685 :
686 rem *** get item ***
687 :
690 ifr<11thengosub3150:goto720
695 :
696 rem *** you're carrying too ***
697 rem *** too many items ***
698 :
700 print"[217]ou're carrying too much. [217]ou should drop something first."
705 :
706 rem *** goto drop section ***
707 :
710 goto500
715 :
716 rem *** set variable to 1 if ***
717 rem *** last 3 letters of noun ***
718 rem *** match item picked up ***
719 :
720 ife$="nts"thenpt=1
730 ife$="tes"thencl=1
740 ife$="bat"thenhb=1
750 ife$="all"thenbt=1
760 ife$="pon"thencp=1
770 ife$="ket"thentk=1
780 ife$="bee"thenfb=1
790 ife$="ash"thench=1
800 ife$="sey"thenjr=1
810 ife$="cap"thenca=1
820 ife$="oke"thenck=1
830 ife$="ney"thenmy=1
835 :
836 rem *** goto delay loop ***
837 :
840 goto2010
845 :
846 rem *** drop command ***
847 :
850 ifd(b)<>2then1050
855 :
856 rem *** find out if item is ***
857 rem *** being carried ***
858 :
860 forj=1to10:ife$=right$(c$(j),3)then880
865 :
868 rem *** you don't have the item ***
869 :
870 next:print"[217]ou're not carrying it.":goto500
872 :
873 rem *** put item back in noun ***
874 rem *** list - remove from ***
875 rem *** carry list - decrement ***
876 rem *** # of items being ***
877 rem *** carried ***
878 :
880 fork=1to58:ifa$(k)=""thena$(k)=c$(j):a(k)=a:h(j)=0:goto900
890 next
900 print"[207][203]!":fork1=1to58:ifc$(j)=h$(k1)thenc$(j)="":r=r-1:goto920
910 next
912 :
913 rem *** after dropping item ***
914 rem *** set variable to 0 if ***
915 rem *** last 3 letters of noun ***
916 rem *** match ***
917 :
920 ife$="all"thenbt=0
930 ife$="bat"thenhb=0
940 ife$="pon"thencp=0
950 ife$="ket"thentk=0
960 ife$="bee"thenfb=0
970 ife$="ash"thench=0
980 ife$="nts"thenpt=0:wp=0:ft=0
990 ife$="tes"thencl=0:wl=0:ft=0
1000 ife$="sey"thenjr=0:wj=0:ft=0
1010 ife$="cap"thenca=0:wc=0:ft=0
1020 ife$="oke"thenck=0
1030 ife$="ney"thenmy=0
1032 :
1033 rem *** goto delay loop ***
1034 :
1040 goto2010
1042 :
1043 rem *** look/read command ***
1044 :
1050 ifd(b)<>3then1110
1052 :
1053 rem *** if room = 2 & noun = ***
1054 rem *** sign then read ***
1055 :
1060 ifa=2ande$="ign"thengosub3200:goto2020
1065 :
1066 rem *** if room = 15 & noun = ***
1067 rem *** sign